using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Messages.Entity
{
    [Table("ReturnStatus", "", "Wicresoft.Messages.ConnectionString")]
    public class ReturnStatus : Info
    {
        #region SQL column name consts
        public const string SQLCOL_QUEUEID = "QueueID";
        public const string SQLCOL_OUTERPK = "OuterPK";
        public const string SQLCOL_DEVICEID = "DeviceID";
        public const string SQLCOL_STATUS = "Status";
        public const string SQLCOL_STATUSDESCRIPTION = "StatusDescription";
        #endregion


        #region Contructors
        /// <summary>
        /// Construct empty entity
        /// </summary>
        public ReturnStatus() { }

        /// <summary>
        /// Construct entity by primary key, other fields will be assigned by 
        /// "Load" method.
        /// </summary>
        public ReturnStatus(Guid QueueID)
        {
            this.QueueID = QueueID;
        }
        #endregion

        public override void Init(DataRow row)
        {
            QueueID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_QUEUEID]);
            OuterPK = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_OUTERPK]);
            DeviceID = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_DEVICEID]);
            Status = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_STATUS]);
            StatusDescription = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_STATUSDESCRIPTION]);
        }

        #region Properties
        #region Property <Guid> QueueID
        [Property("QueueID", 16, SqlDbType.UniqueIdentifier, false, true)]
        public Guid QueueID
        {
            get { return _QueueID; }
            set { _QueueID = value; }
        }
        private Guid _QueueID = Guid.Empty;
        #endregion

        #region Property <string> OuterPK
        [Property("OuterPK", 100, SqlDbType.NVarChar, false, false)]
        public string OuterPK
        {
            get { return _OuterPK; }
            set { _OuterPK = value; }
        }
        private string _OuterPK = null;
        #endregion

        #region Property <int> DeviceID
        [Property("DeviceID", 4, SqlDbType.Int, false, false)]
        public int DeviceID
        {
            get { return _DeviceID; }
            set { _DeviceID = value; }
        }
        private int _DeviceID = int.MinValue;
        #endregion

        #region Property <int> Status
        [Property("Status", 4, SqlDbType.Int, false, false)]
        public int Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        private int _Status = int.MinValue;
        #endregion

        #region Property <string> StatusDescription
        [Property("StatusDescription", 100, SqlDbType.NVarChar, false, false)]
        public string StatusDescription
        {
            get { return _StatusDescription; }
            set { _StatusDescription = value; }
        }
        private string _StatusDescription = null;
        #endregion
        #endregion




    }
}
